#{extends 'main.html' /}
#{set title:'Search results' /}

#{form @BookSearch.search()}
	<input type="text" name="query" id="query" value="${query}"/>
	<input type="submit" value="Search" />
#{/form}


<ol class="books">
    #{list items:books.items, as:'book'}
    <li style="clear:left" class="book">
        <div class="book">
            <span class="title"><a href="@{BookDetails.show(book.id)}">${book.name}</a></span>
            <span class="libraries">[ #{list items:book.libraries, as:'lib'}${lib}${lib_isLast?'':', '}#{/list}#{else}Not Avialable#{/else} ]</span>
            <div>
                <img class="thumbnail" src="@{BookDetails.getBookThumbnail(book.id)}" style="float:left; margin: 4px; "/>
                <div class="authors"><span class="label">Authors:</span> #{list items:book.authors, as:'author'}${author}${author_isLast?'.':', '}#{/list}</div>
                <div class="description">${book.description?.substring(0,Math.min(book.description.length()-1, 400)).nl2br()}${book.description?.length()>400?'...':''}</div>
            </div>
            <div class="actions">
                #{if (book.avilable)}
                <a href="@{BookActions.borrow(book.id)}">Borrow Book</a>
                <a href="@{BookActions.borrowJQuery(book.id)}">Borrow Book jQuery</a>
                #{/if}    
            </div>
            
            
			
        </div>
    </li>
    #{/list}
</ol>


Page:${books.page}
Count:${books.count}



